﻿namespace WebPacker.Tests.Helpers
{
	using System;
	using NUnit.Framework;
	using WebPacker.Helpers;

	[TestFixture]
	public class DateTimeHelperTest
	{
		[Test]
		public void ToTimestampTest()
		{
			var expected = 1234567890;
			var actual = DateTimeHelper.ToTimestamp(new DateTime(2009, 02, 13, 23, 31, 30));
			Assert.AreEqual(expected, actual);
		}

		[Test]
		public void FromTimestampTest()
		{
			var expected = new DateTime(2004, 1, 10, 13, 37, 04);
			var actual = DateTimeHelper.FromTimestamp((long)Math.Pow(2, 30));
			Assert.AreEqual(expected, actual);
		}
	}
}
